<template>
  <ul class="todo-list">
    <!-- completed: 完成的类名 -->
    <li :class="{completed:item.isDone}" v-for="item in List" :key="item.id">
      <div class="view">
        <input class="toggle" type="checkbox" v-model="item.isDone" />
        <label>{{item.taskName}}</label>
        <button class="destroy" @click="$store.commit('DEL_TASK',item.id)"></button>
      </div>
    </li>
  </ul>
  
</template>

<script>
import { mapGetters } from 'vuex';
export default {
  computed: {
    ...mapGetters(['List'])
  }
}
</script>
